from flask import Flask, jsonify
from flask_cors import CORS
from handle.data_analysis import *

app = Flask(__name__)
CORS(app, resources=r"/*")


@app.route('/')
def hello_world():  # put application's code here
    return 'Hello World!'


@app.route('/heatmap', methods=['POST'])
def heatmap():
    return jsonify(data_heatmap())


@app.route('/graph', methods=['POST'])
def graph():
    return jsonify(data_graph())


@app.route('/scatter', methods=['POST'])
def scatter():
    return jsonify(data_scatter())


@app.route('/pie_annular', methods=['POST'])
def pie_annular():
    return jsonify(data_pie_and_annular())


@app.route('/line_bar', methods=['POST'])
def line_bar():
    return jsonify(data_line_and_bar())


@app.route('/wordCloud', methods=['POST'])
def word_cloud():
    return jsonify(data_wordcloud())


if __name__ == '__main__':
    app.run(debug=True)
